Fixes #38072 - add host bootc_images endpoint #11257
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the changes introduced in this pull request?
Adds a new
/hosts/bootc_images
endpoint that returns an overview of all bootc images that hosts are using.The return data looks like the following:
This data will power a page that shows a list of image paths and each image mode host that is using that image path. Since each host could use the same image but a different digest, each image path holds any number of digests with the count of hosts that are using that digest. More digests per image path means more drift from the latest container content under that container tag.
Considerations taken when implementing this change?
Choosing where this goes was difficult -- it's related to hosts so I decided to stick it under the hosts endpoint. I use facts as a similar paradigm: host facts and bootc images are both aggregate information from hosts that are available at a single API endpoint.
What are the testing steps for this pull request?
curl "https://`hostname`/api/hosts/bootc_images?per_page=5&page=7" -uadmin:pass